package cc.rengu.redp.bizimpl.upmp.service;

import cc.rengu.redp.bizimpl.upmp.domain.BTermBrandInfo;
import cc.rengu.redp.bizimpl.upmp.vo.BTermBrandInfoVO;
import cc.rengu.redp.common.domain.QueryRequest;
import cc.rengu.redp.common.exception.RedpException;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author lizk
 */
public interface IBTermBrandInfoService extends IService<BTermBrandInfo> {

    IPage<BTermBrandInfo> findByPage(QueryRequest request, BTermBrandInfo brand);

    @Transactional
    void createBrand(BTermBrandInfoVO brand) throws RedpException;

    @Transactional
    void updateBrand(BTermBrandInfoVO brand) throws RedpException ;

    boolean count(String brandName);

    List<BTermBrandInfo> findTests();

    /**
     * 批量插入
     *
     * @param list List<BTermBrandInfoVO>
     */
    @Transactional
    void batchInsert(List<BTermBrandInfoVO> list) throws RedpException ;

    List<BTermBrandInfo> getBrandCode(String instId);

    Map<String, Object> termbrandSelect2List(String q, QueryRequest request);

    BTermBrandInfo getBrandCodeAndName(String brandCode);

    BTermBrandInfo findTermBrand(String brandCode);
}
